#pragma once
#include <d3dx9.h>
#include "cMacro.h"

class cObject;

class cCamera
{
	D3DXVECTOR3 mPos;
	D3DXVECTOR3 mUp;

public:
	D3DXVECTOR3 mTarget;

	float mfDist;
	float mYrot;
	float mXrot;
	cObject* mTargetObj;
	
public:
	cCamera(void);
	~cCamera(void);
	
	D3DXVECTOR3 getPosition() { return mPos; }


	void strafe(float units);
	void fly(float units);
	void walk(float units);

	void pitch(float angle);
	void yaw(float angle);
	void roll(float angle);

	void pitch3(float angle);
	void yaw3(float angle);

	void reCalc(D3DXVECTOR3 old, D3DXVECTOR3 oldTarget);

	void SetTargetObj(cObject* obj);

	D3DXMATRIX getViewTM();
	D3DXMATRIX getBillboardTM();
	D3DXMATRIX getBillboardTM_Y(D3DXVECTOR3& Lookat);

	void ProcessKeyInput();
};

extern cCamera* gpCamera;